package com.study.aoki.reactive.repository

import com.study.aoki.reactive.bean.model.User
import org.springframework.data.r2dbc.repository.Query
import org.springframework.data.repository.reactive.ReactiveCrudRepository
import org.springframework.stereotype.Repository
import reactor.core.publisher.Mono

/**
 * @author jiahan.zhou
 * @date 2020/11/24
 */
@Repository
interface UserRepository : ReactiveCrudRepository<User, Long> {

    @Query("""
        select * from user where phone = :phone
    """)
    fun findByPhone(phone: String): Mono<User>
}